#ifndef _SCANNER_H
#define _SCANNER_H

#define MAX_NAME_SZ  64
#define MAX_RA_TOKEN 16

extern FILE *input_fp;
extern int line_no;

struct cminus_token
{
  int type;
  char name[MAX_NAME_SZ];
};

enum token_type
{
  // reserved Keyword 1-8
  INT = 1, ELSE, VOID, IF, WHILE, READ, WRITE, RETURN,

  // operations 9-19
  ASSIGN, PLUS, MINUS, TIMES, DIV, LT, GT, NLT, NGT, EQ, NEQ,

  // interpunctions 20-27
  LPARAN, RPARAN, LBRACE, RBRACE, LSQUARE, RSQUARE, COMMA, SEMI,

  // others 27-28
  ID, NUM,
};

extern struct cminus_token token_buffer[MAX_RA_TOKEN];

struct cminus_token get_token();
int virtual_get_token(int num);

#endif
